<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>欢迎登录MoeTube!</title>

<link rel="stylesheet" type="text/css" href="/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="/css/demo.css" />
<!--必要样式-->
<link rel="stylesheet" type="text/css" href="/css/component.css" />
<link rel="stylesheet" type="text/css" href="/css/all.css" />
<link rel="stylesheet" type="text/css" href="/css/pages-login.css" />
<script src="/js/vue.js"></script>
<script src="/js/axios.js"></script>
<!--[if IE]>
	<script src="/js/html5.js"></script>
	<![endif]-->
</head>
<body>
		<div class="container demo-1" id="app">
			<div class="content">
				<div id="large-header" class="large-header">
					<canvas id="demo-canvas"></canvas>
					<div class="logo_box">
						<h3>欢迎你</h3>
						<form action="#" name="f" method="post">
							<div class="input_outer">
								<span class="u_user"></span>
								<input v-model="username" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入账户">
							</div>
							<div class="input_outer">
								<span class="us_uer"></span>
								<input v-model="password" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"value="" type="password" placeholder="请输入密码">
							</div>
							<div class="mb2"><a class="act-but submit" @click="login()" href="javascript:;" style="color: #FFFFFF">登录</a></div>
						</form>
					</div>
				</div>
			</div>
		</div><!-- /container -->
		<script src="/js/TweenLite.min.js"></script>
		<script src="/js/EasePack.min.js"></script>
		<script src="/js/rAF.js"></script>
		<script src="/js/demo-1.js"></script>

		<script th:inline="javascript">
            var app = new Vue({
                el:"#app",
                data:{
                    username:"",
                    password:"",
                    msg:"",
                    from: [[${from}]]
                },
                methods:{
                    login:function(){
                        app.msg="正在登录";
                        axios.post("/api/oauth/login?username="+app.username+"&password="+app.password)
                            .then(function (response) {
                                if (response.data.flag){
                                    app.msg="登录成功";
                                    location.href = "/api/search/list?keywords=";
                                }else{
                                    alert("账号或者密码错误！");
                                }
                            })
                    }
                }
            })
		</script>
	</body>
</html>
